﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Chbl.DAL;
using Chbl.Models;

namespace Chbl.Controllers
{ 
    public class SeasonDivisionController : Controller
    {
        private readonly ChblDb _db;

        public SeasonDivisionController(ChblDb chblDb)
        {
            _db = chblDb;
        }

        //
        // GET: /SeasonDivision/
        public ViewResult Index(int seasonId)
        {
            var seasondivisions =
                _db.SeasonDivisions.Include(s => s.Season).Include(s => s.Division).Where(s => s.SeasonId == seasonId);
            return View(seasondivisions.ToList());
        }

        //
        // GET: /SeasonDivision/Details/5

        public ViewResult Details(int id)
        {
            SeasonDivision seasondivision = _db.SeasonDivisions.Find(id);
            return View(seasondivision);
        }
       
        protected override void Dispose(bool disposing)
        {
            _db.Dispose();
            base.Dispose(disposing);
        }
    }
}